package com.example.weather_plus.data.retrofit;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class RetrofitClient {
    private Retrofit retrofit = null;


    public RetrofitClient() {
    }

    public Retrofit getInstance(String baseUrl) {
        if (retrofit == null) {
            retrofit = new Retrofit.Builder().baseUrl(baseUrl).addConverterFactory(GsonConverterFactory.create())
                    // 如果你想添加OkHttp的 Logging Interceptor，可以在这里添加
                    //.client(getLoggingInterceptor())
                    .build();
        }
        return retrofit;
    }
}